//
//  LCZCollectionViewCell.m
//  PersonalNews
//
//  Created by Golibyo on 15/11/27.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import "LCZCollectionViewCell.h"
#import "LCZFirstTableViewCell.h"
@implementation LCZCollectionViewCell

- (void)setCListArr:(NSMutableArray *)cListArr {
    if (_cListArr != cListArr) {
        _cListArr = cListArr;
    }
    [self.tableView reloadData];
}



- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.tableView = [[LCZBaseTableView alloc] initWithFrame:CGRectMake(0, HEIGHT / 667.0 * 20, WIDTH, HEIGHT / 667.0 * 605) style:UITableViewStylePlain];
        self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self addSubview:self.tableView];
        self.tableView.delegate = self;
        self.tableView.dataSource = self;
        self.tableView.rowHeight = 250;
        [self.tableView registerClass:[LCZFirstTableViewCell class] forCellReuseIdentifier:@"reuse"];
    }
    return self;
}




- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.cListArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    LCZFirstTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuse" forIndexPath:indexPath];
//    cell.backgroundColor = [UIColor grayColor];
    cell.typeLabel.text = [NSString stringWithFormat:@"%@", self.cListArr[indexPath.row][@"cname"]];
    
    cell.tListArr = self.cListArr[indexPath.row][@"tList"];
    
    return cell;
}

//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//    [self.delegate tableHeadPush:self.cListArr[indexPath.row][@"cid"]];
//}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
